﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <base href="/" />
    <title>@AppConfig.AppName</title>
    <KStyleSheet />
    <link rel="icon" type="image/png" href="favicon.png" />
    <link rel="manifest" href="manifest.json" />
    <link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
    <link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />
</head>
<body>
    <div class="loading"></div>
    <Routes @rendermode="Context.RenderMode" Context="Context" />
    <KScript />
    <script src="_framework/blazor.web.js"></script>
</body>
</html>

@code {
    [Inject] private UIContext Context { get; set; }
    [CascadingParameter] private HttpContext HttpContext { get; set; }

    protected override void OnInitialized()
    {
        base.OnInitialized();
        Context.IPAddress = HttpContext.Connection?.RemoteIpAddress?.ToString();
        Context.IsMobile = HttpContext.CheckMobile();
        Config.HostUrl = HttpContext.GetHostUrl();
    }
}